package model

import (
	"babyplan/model/common"
	"babyplan/vo"
	"cftgo/cftc"

	"github.com/mitchellh/mapstructure"
)

type Video struct {
	EntityId  cftc.EntityId     `gorm:"primaryKey;column:entity_id"`
	AlbumId   cftc.EntityId     `gorm:"index;uniqueIndex:uk_album_id_filename;column:album_id"`
	FileName  string            `gorm:"comment;uniqueIndex:uk_album_id_filename;文件名"`
	Bookmarks []common.Bookmark `gorm:"comment:bookmarks"`
	CreatedAt int64             `gorm:"comment:创建时间"`
	UpdatedAt int64             `gorm:"comment:更新时间"`
}

func (this *Video) TableName() string {
	return "t_video"
}

func (this *Video) ToVo() *vo.Video {
	vobj := new(vo.Video)
	err := mapstructure.Decode(this, vobj)
	if err != nil {
	}
	return vobj
}
